home *** CD-ROM | disk | FTP | other *** search
- #include <proto/dos.h>
- #include <proto/exec.h>
- #include <string.h>
-
- extern struct WBStartup *_WBenchMsg;
- extern char __stdiowin[];
- extern long __oslibversion;
- void _XCEXIT(int);
-
- void __autoopenfail(char *lib)
- {
- struct DOSBase *DOSBase;
- long fh;
- char numbers[4];
- int temp;
-
- DOSBase = (struct DOSBase *)OpenLibrary("dos.library",0);
- if (_WBenchMsg)
- fh = Open(__stdiowin, MODE_NEWFILE);
- else
- fh = Output();
-
- Write(fh, "Can't open version ", 20);
- temp = __oslibversion;
- numbers[0] = temp >= 100 ? '0' + temp/100 : ' ';
- temp = temp % 100;
- numbers[1] = temp >= 10 ? '0' + temp/10 : ' ';
- temp = temp % 10;
- numbers[2] = '0' + temp;
-
- Write(fh, numbers, 3);
- Write(fh, " of \"", 5);
- Write(fh, lib, strlen(lib));
- Write(fh, "\"\n",2);
-
- if (_WBenchMsg)
- {
- Delay(200);
- Close(fh);
- }
-
- CloseLibrary((struct Library *)DOSBase);
- _XCEXIT(20);
- }
-